/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2016年6月16日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package singleton;

/**
 * @Type SimpleSingleton
 * @Desc
 * @author boboge
 * @date 2016年6月16日
 * @Version V1.0
 */
public class SimpleSingleton {

    private int num = 0;

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    private static SimpleSingleton simpleSingleton = new SimpleSingleton();

    private SimpleSingleton() {

    }

    public static SimpleSingleton getInstans() {
        return simpleSingleton;
    }

    public static void main(String[] args) {
        SimpleSingleton simpleSingleton = SimpleSingleton.getInstans();
        simpleSingleton.setNum(111);
        SimpleSingleton simpleSingleton2 = SimpleSingleton.getInstans();
        System.out.println(simpleSingleton.getNum());

    }

}
